<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>コントロールパネル</title>
		<link rel="stylesheet" href="./assets/styles/default.css" type="text/css" />
		
		<link rel="stylesheet" href="./assets/styles/ui-lightness/ui.all.css" type="text/css" />
		
		<link rel="stylesheet" href="./assets/styles/ui-lightness/jquery-ui-1.7.3.custom.css" type="text/css" />
		<link rel="stylesheet" href="./assets/styles/dialog.css" type="text/css" />
		
		<script src="assets/scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
		<script src="assets/scripts/jquery-ui-1.7.3.custom.min.js" type="text/javascript"></script>
		<script src="assets/scripts/ui/ui.dialog.js" type="text/javascript"></script>
		
		
		<script src="assets/scripts/menu.js" type="text/javascript"></script>
		<script src="assets/scripts/table.js" type="text/javascript"></script>
		<script type="text/javascript" src="./assets/scripts/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="./assets/scripts/editor.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.datepicker.js"></script>
		<script type="text/javascript" src="./assets/scripts/ui/ui.core.js"></script>

		<script type="text/javascript">
		$(function() {
			$('.message').fadeIn("slow");
			$('.btn_regist').click(function(){
				if( confirm('登録してよろしいですか？') ){
					document.fm.mode.value = 'input';
					document.fm.submit();
				}
			});
			
			$('.btn_update').click(function(){
				if( confirm('更新してよろしいですか？') ){
					document.fm.mode.value = 'input';
					document.fm.submit();
				}
			});
			$('.btn_return').click(function(){
				location.href = "mins_delive_index.php?hist=2";
			});
		});
	</script>
		
	</head>
	<body id="">
{{ $menu }}
{{ $logout }}
		<div id="container"><div class="wrapper">
			<h2>折込販売店マスター管理</h2>
			 <ul class="submenu clearfix">
				<li><a href="minsshop_index.php">折込販売店情報一覧</a></li>
				{{ if (!$isG4) }} <li><a href="minsshop_form.php">折込販売店情報登録</a></li>{{ /if }}
				<li><a href="minsshop_import.php">CSV更新</a></li>
				<li>納品先マスタ</li>
			</ul>
			<h3>納品先情報{{ if $forms.id == '' }}登録{{ else }}更新{{ /if }}{{ if $phase == 'complete' }}完了{{ /if }}</h3>
{{ if $phase == 'input' }}
			<p class="message">内容を確認し、{{ if $forms.id == '' }}登録{{ else }}更新{{ /if }}ボタンをクリックしてください。</p>
			<form name="fm" action="mins_delive_form.php" method="post">
			
			<input type="hidden" name="matrix_cd" value="{{ $forms.matrix_cd}}" />
				<table class="formTable">
					<tbody>
{{ if $forms.id != '' }}
						<tr>
							<th>更新日</th>
							<td>
								{{ $forms.u_time }}<input type="hidden" name="u_time" value="{{ $forms.u_time }}" />
							</td>
						</tr>
						
						<tr>
							<th>更新者</th>
							<td>
								{{ $forms.m_user_name }}<input type="hidden" name="m_user_name" value="{{ $forms.m_user_name }}" />
							</td>
						</tr>
						<tr>
							<th>週名/折込日</th>
							<td>
								{{ $forms.week_name }}<input type="hidden" name="week_name" value="{{ $forms.week_name }}" />
							</td>
						</tr>
<!--  						<tr>
							<th>ID</th>
							<td>
								{{ $forms.delive_cd }}
							</td>
						</tr>
					-->
{{ /if }}
						<tr>
							<th style="width:160px"><span>※</span>折込会社</th>
							<td>
{{ if ($isG4) }} 
							<input type="text " name="ins_co_name"  class="dtext" value="{{ $forms.ins_co_name }}"  readonly/>
							<input type="hidden" name="ins_co_cd" value="{{ $forms.ins_co_cd }}" />
{{ else }}
							{{ html_options id='ins_co_cd' name='ins_co_cd' options=$ins_co selected=$forms.ins_co_cd }}{{ $err.ins_co_cd }}
{{ /if }}
							</td>
						</tr>
						<tr><th style="width:160px"><span>※</span>納品先コード</th>
							<td>
							{{ if $forms.id != '' }}
								<input type="text" name="delive_cd" class="dtext" value="{{ $forms.delive_cd|escape }}"  readonly/>
							{{ else }}
								<input type="text" name="delive_cd" class="text" value="{{ $forms.delive_cd|escape }}" />{{ $err.delive_cd }}
							{{ /if }}
							</td>
						</tr>
						<tr><th style="width:160px"><span>※</span>納品先名 </th>
							<td>
								<input type="text" name="delive_name" class="text" value="{{ $forms.delive_name|escape }}"   />{{ $err.delive_name }}
							</td>
						</tr>
{{ if $forms.id != '' }}
						<tr><th style="width:160px"><span>※</span>締切日時</th>
							<td>
								{{ html_options id='close_day' name='close_day' options=$close_day selected=$forms.close_day }} 日前の 
								{{ html_options id='close_time' name='close_time' options=$close_time selected=$forms.close_time }}時{{ $err.close_day_time }}
							</td>
						</tr>
						<tr><th style="width:160px">郵便番号</th>
							<td>
								<input type="text" name="postcode" class="text" value="{{ $forms.postcode|escape }}" />{{ $err.postcode }}
							</td>
						</tr>
						<tr><th style="width:160px">住所</th>
							<td>
								<input type="text" name="address" class="text" value="{{ $forms.address|escape }}" />{{ $err.address }}
							</td>
						</tr>
						<tr><th style="width:160px">電話番号</th>
							<td>
								<input type="text" name="tel" class="text" value="{{ $forms.tel|escape }}" />{{ $err.tel }}
							</td>
						</tr>
{{ /if }}
					</tbody>
				</table>
				<p class="button">
{{ if $forms.id != '' }}
					<button type="button" class="btn_return" class="submit"><span>戻る</span></button>
					<button type="button" class="btn_update" class="submit"><span>更新</span></button>
{{ else }}
					<button type="button" class="btn_regist" class="submit"><span>登録</span></button>
{{ /if }}
				</p>
				<input type="hidden" name="id" value="{{ $forms.id }}" />
				<input type="hidden" name="mode" value="" />
			</form>

<div id="dialog" >
</div>
 
{{ /if }}

{{ if $phase == 'complete' }}
<p class="message">{{ $message }}</p>
<ul>
{{ if $forms.id != '' }}
				<li>>> <a href="mins_delive_index.php?hist=2">一覧ページに戻る</a></li>
{{ else }}
				<li>>> <a href="mins_delive_index.php?hist=2">一覧ページに戻る</a></li>
{{ /if }}
				<li>>> <a href="mins_delive_form.php?w={{ $forms.matrix_cd }}">新規登録</a></li>
{{ if $forms.id != '' }}
				<li>>> <a href="mins_delive_form.php?w={{ $forms.matrix_cd }}&id={{ $forms.id }}">更新</a></li>
{{ /if }}
</ul>
{{ /if }}

		</div></div>
		{{ $footer }}
	</body>
</html>